﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity.Infrastructure;

namespace ERPStore.Coupons.Repositories
{
    public class DbContextFactory : CloudSoft.Repositories.IDbContextFactory<CouponDbContext>
    {
		public DbContextFactory()
		{

		}

		public CouponDbContext GetDbContext()
        {
            var nlCs = System.Configuration.ConfigurationManager.ConnectionStrings["ERPStoreConnectionString"].ConnectionString;
			var dbContext = new CouponDbContext(nlCs);
            return dbContext;
        }

        public IObjectContextAdapter GetObjectContextAdapter()
        {
            var dbContext = GetDbContext();
            return (IObjectContextAdapter)dbContext;
        }

		public void Dispose()
		{

		}
    }
}
